
// 153.寻找旋转排序数组中的最小值
class Solution {
public:
    int findMin(vector<int>& nums) {
        // 使用二分来解决
        int n = nums.size();
        int left = -1 , right = n - 1;
        while(left + 1 < right)
        {
            int mid = left + (right - left)/2;
            if(nums[mid] > nums[right]) left = mid;
            else right = mid;
        }
        return nums[right];
    }
};